﻿using HtmlAgilityPack;

namespace JoelAbrahamsson.Web.Common.HtmlFiltering
{
    public class CodeTagReplacer : IHtmlTagReplacer
    {
        public string BrushName { get; set; }

        public CodeTagReplacer()
        {
            BrushName = "plain";
        }

        public string ReplaceOpeningTag(HtmlNode node)
        {
            return string.Format("<pre class=\"brush: {0};\">", BrushName);
        }

        public string ReplaceClosingTag(HtmlNode node)
        {
            return "</pre>";
        }
    }
}